#ifndef _WX_STACKWALK_H_
#define _WX_STACKWALK_H_

#include "wx/defs.h"

class wxStackFrame;

class wxStackFrameBase {
  private:
    wxStackFrameBase *ConstCast() const { return wx_const_cast( wxStackFrameBase *, this ); }

  public:
    wxStackFrameBase( size_t level, void *address = NULL ) {
      m_level = level;
      m_line =
        m_offset = 0;
      m_address = address;
    }
    size_t GetLevel() const { return m_level; }
    void *GetAddress() const { return m_address; }
    wxString GetName() const { ConstCast()->OnGetName(); return m_name; }
    size_t GetOffset() const { ConstCast()->OnGetName(); return m_offset; }
    wxString GetModule() const { ConstCast()->OnGetName(); return m_module; }
    bool HasSourceLocation() const { return !GetFileName().empty(); }
    wxString GetFileName() const { ConstCast()->OnGetLocation(); return m_filename; }
    size_t GetLine() const { ConstCast()->OnGetLocation(); return m_line; }
    virtual size_t GetParamCount() const { return 0; }
    virtual bool GetParam( size_t ( n ), wxString * ( type ), wxString * ( name ), wxString * ( value ) ) const {
      return false;
    }
    virtual ~wxStackFrameBase() { }
  protected:
    virtual void OnGetName() { }
    virtual void OnGetLocation() { }
    size_t m_level;
    wxString m_name,m_module,m_filename;
    size_t m_line;
    void *m_address;
    size_t m_offset;
};

class wxStackWalkerBase {
  public:
    wxStackWalkerBase() { }
    virtual ~wxStackWalkerBase() { }
    virtual void Walk( size_t skip = 1, size_t maxDepth = 200 ) = 0;
    virtual void WalkFromException() = 0;
  protected:
    virtual void OnStackFrame( const wxStackFrame& frame ) = 0;
};
#include "wx/unix/stackwalk.h"

#endif
